package com.st.valid.jsr3.simple.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.*;
import java.util.Date;

/**
 * @创建人: 放生
 * @创建时间: 2022/4/2
 * @描述:
 */
@lombok.Data
public class RequestVo {

    @NotNull(message = "id 不能为空")
    private Long id;

    @Min(value = 10,message = "年龄必须大于等于10岁")
    private Integer age;

    @Length(min = 5,max = 20,message = "名字的长度必须在5-10之间")
    private String name;

    @Email(message = "email format is error")
    private String email;

    @NotBlank(message = "地址不能为空")
    private String address;

    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$", message = "请填写正确的手机号")
    private String phone;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @Past(message = "必须是一个过去的时间")
    private Date  begin;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @Future(message = "必须是一个将来的时间")
    private Date  end;






}
